
<Script>
 var base_url            = 'http://works:8080';
  var jq = jQuery.noConflict();

function checkLogin(){


var strpost = 'txtemail=' + jq('#txtemail').val();
    strpost += '&password=' + jq('#password').val();


    jq.ajax({
            type: "POST",
            cache: false,
            url: base_url+ "/dang-nhap/thanh-cong",
            data: strpost,
            timeout: 600000,
            error: function(xhr, ajaxOptions, thrownError) {
                alert("có lỗi xảy ra");
            },
            success: function(data) {
                alert(data);
            }
        });


}

function checkLogout(){

    jq.ajax({
            type: "POST",
            cache: false,
            url: base_url+ "/thoat-he-thong",
            data: '',
            timeout: 600000,
            error: function(xhr, ajaxOptions, thrownError) {
                alert("có lỗi xảy ra");
            },
            success: function(data) {
                
            }
        });


}


</script>
<form name="frmEdit" id="frmEdit" method="post" enctype="multipart-formdata">
        <fieldset>
        <legend>Login</legend>

         <label>Email</label><input type="text" name="txtemail" value="" id="txtemail" size="30"><br>


        <label>Password</label><input type="password" name="password" value="" id="lname" size="30"><br>


        <label>&nbsp;</label> <input type="button" name="btnlogin" value="Login" onclick="return checkLogin();"><br>


        <label><a href="javascript:void(0);" onclick="checklogout();">Logout</a></label>

        </fieldset>
    </form>